<?php
namespace App\Http\ModelDao\Flow;

use App\Enum\ClassListHistoryEnum;

class ClassFlowDao
{
    public static function classFlowList($classFlowData): array
    {
        $ret = [];
        Foreach ($classFlowData as & $val) {
            $val = (array) $val;
            $ret[] = [
                'push_time' => $val['push_time'],
                'city_name' => $val['city_name'],
                'main_name' => $val['ledger_subject_name'], //主体名称
                'class_id' => $val['class_id'],
                'class_name' => $val['class_name'],
                /*'fee_amount' => 0, //费用金额
                'fee_type' => '', //费用类型*/
                'begin_date' => $val['begin_date'], //开课日期
                'end_date' => $val['end_date'], // 结课日期
                'class_type' => in_array($val['class_type'], array_keys(ClassListHistoryEnum::$class_type)) ? ClassListHistoryEnum::$class_type[$val['class_type']] : '未知', //课程类型
                'push_status' => in_array($val['result'], array_keys(ClassListHistoryEnum::$push_status)) ? ClassListHistoryEnum::$push_status[$val['result']] : '未知', //推送状态
                'result_desc' => $val['result_desc']//描述信息
            ];
        }

        return !empty($ret) ? $ret : [];
    }
}
